<?php
JunctionFileCabinet::using("Junction_Mapping_Core");
JunctionFileCabinet::using("Junction_Core_Factory");
// TODO probably make an interface for these methods so that
// the null base can simply implement that, then this class
// can declare the methods final (if that's legal...)
class Junction_Core_Base {
	
	private $_record;
	
	/**
	 * @var Junction_Mapping
	 */
	private $_mapping;
	
	public final function __construct(array $record, Junction_Mapping_Core $map) {
		$this->_mapping = $map;
		$this->_record = $record;
	}

	/**
	 * @throws Junction_Mapping_Exception
	 * @param String $property
	 */
	public final function read($property) {
		return $this->_mapping->read($property, $this->_record);
	}
	
	/**
	 * @throws Junction_Mapping_Exception
	 * @param String $property
	 * @param unknown_type $value
	 */
	public function write($property, $value) {
		$this->_mapping->write($property, $value, $this->_record);
	}
}
?>